<template>
    <div class="docker">
        <van-tabbar v-model="navActive">
            <van-tabbar-item icon="wap-home" @click="go('/')">首页</van-tabbar-item>
            <van-tabbar-item icon="shopping-cart" @click="go('/cart')">购物车</van-tabbar-item>
            <van-tabbar-item icon="bars" @click="go('/order')">订单</van-tabbar-item>
            <van-tabbar-item icon="manager" @click="go('/mine')">我的</van-tabbar-item>
        </van-tabbar>
    </div>
</template>

<script setup>
import { reactive, ref } from 'vue';
import { useRouter } from 'vue-router';
import { useStore } from 'vuex';

let router = useRouter();
let store = useStore();
let go = path => {
    store.commit('changeRouterType', 'push');
    router.push(path);
};
defineProps({
    navActive: Number,
});
</script>

<style lang="scss" scoped>
@import '../style/base.scss';
.docker {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 0.5rem;
    background-color: #ffffff;
    box-shadow: 0 -0.01rem 0.01rem 0 #f1f1f1;
    @include flexSet(space-evenly, center, none);
    .nav {
        width: 0.5rem;
        height: 0.36rem;
        .nav_icon {
            margin: 0 auto 0.02rem;
            width: 0.2rem;
            height: 0.2rem;
            i {
                font-size: 0.2rem;
            }
        }
        .nav_title {
            width: 0.5rem;
            height: 0.14rem;
            font-size: 0.14rem;
            line-height: 0.14rem;
            text-align: center;
            color: #333333;
        }
    }
    button {
        width: 0.5rem;
        height: 0.14rem;
        font-size: 0.14rem;
        line-height: 0.14rem;
        text-align: center;
        color: #333333;
    }
    .iconFont {
        color: #3a6ff3;
    }
}
</style>
